package com.briup.gxqd.controller;

import com.briup.gxqd.utils.Message;
import com.briup.gxqd.utils.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: qxqd
 * @description: 历史数据控制器
 * @author: rendc
 * @create: 2020-06-11 16:41
 **/
@RestController
@RequestMapping("history")
@Api(description = "疫情历史数据管理接口")

public class HistoryController {


    //1. 疫情历史数据
    @ApiOperation(value = "疫情历史数据")
    @GetMapping("findAllHistory")
    public Message findAllHistory() {

        // 1.疫情关注度数据
        String dataEC = new String("[{\"value\":335,\"name\":\"直接访问\"},{\"value\":310,\"name\":\"邮件营销\"},{\"value\":274,\"name\":\"联盟广告\"},{\"value\":235,\"name\":\"视频广告\"},{\"value\":400,\"name\":\"搜索引擎\"}]\n");

        // 2.疫情指数数据
        String dataBJ = new String("[[1,55,9,56,46,18,6,\"良\"],[2,25,11,21,65,34,9,\"优\"],[3,56,7,63,3,14,5,\"良\"],[4,33,7,29,33,16,6,\"优\"],[5,42,24,44,76,40,16,\"优\"],[6,82,58,90,77,68,33,\"良\"],[7,74,49,77,46,48,27,\"良\"],[8,78,55,80,29,59,29,\"良\"],[9,267,216,280,48,108,64,\"重度\"],[10,185,127,216,52,61,27,\"中度\"],[11,39,19,38,57,31,15,\"优\"],[12,41,11,40,43,21,7,\"优\"],[13,64,38,74,4,46,22,\"良\"],[14,108,79,120,7,75,41,\"轻度\"],[15,108,63,116,48,44,26,\"轻度\"],[16,33,6,29,34,13,5,\"优\"],[17,94,66,110,54,62,31,\"良\"],[18,186,142,192,88,93,79,\"中度\"],[19,57,31,54,96,32,14,\"良\"],[20,22,8,17,48,23,10,\"优\"],[21,39,15,36,61,29,13,\"优\"],[22,94,69,114,28,73,39,\"良\"],[23,99,73,110,24,76,48,\"良\"],[24,31,12,30,5,32,16,\"优\"],[25,42,27,43,1,53,22,\"优\"],[26,154,117,157,35,92,58,\"中度\"],[27,234,185,230,49,123,69,\"重度\"],[28,160,120,186,77,91,50,\"中度\"],[29,134,96,165,76,83,41,\"轻度\"],[30,52,24,60,3,50,21,\"良\"],[31,46,5,49,28,10,6,\"优\"]]");
        String dataWH = new String("[[1,26,37,27,163,27,13,\"优\"],[2,85,62,71,195,60,8,\"良\"],[3,78,38,74,363,37,7,\"良\"],[4,21,21,36,634,40,9,\"优\"],[5,41,42,46,915,81,13,\"优\"],[6,56,52,69,67,92,16,\"良\"],[7,64,30,28,924,51,2,\"良\"],[8,55,48,74,236,75,26,\"良\"],[9,76,85,113,237,114,27,\"良\"],[10,91,81,104,41,56,40,\"良\"],[11,84,39,60,964,25,11,\"良\"],[12,64,51,101,862,58,23,\"良\"],[13,70,69,120,198,65,36,\"良\"],[14,77,105,178,549,64,16,\"良\"],[15,109,68,87,996,74,29,\"轻度\"],[16,73,68,97,905,51,34,\"良\"],[17,54,27,47,592,53,12,\"良\"],[18,51,61,97,811,65,19,\"良\"],[19,91,71,121,374,43,18,\"良\"],[20,73,102,182,787,44,19,\"良\"],[21,73,50,76,717,31,20,\"良\"],[22,84,94,140,238,68,18,\"良\"],[23,93,77,104,165,53,7,\"良\"],[24,99,130,227,97,55,15,\"良\"],[25,146,84,139,94,40,17,\"轻度\"],[26,113,108,137,481,48,15,\"轻度\"],[27,81,48,62,619,26,3,\"良\"],[28,56,48,68,336,37,9,\"良\"],[29,82,92,174,29,34,13,\"良\"],[30,106,116,188,28,101,16,\"轻度\"],[31,118,50,0,383,76,11,\"轻度\"]]");
        String dataSH = new String("[[1,91,45,125,82,34,23,\"良\"],[2,65,27,78,86,45,29,\"良\"],[3,83,60,84,9,73,27,\"良\"],[4,109,81,121,28,68,51,\"轻度\"],[5,106,77,114,7,55,51,\"轻度\"],[6,109,81,121,28,68,51,\"轻度\"],[7,106,77,114,7,55,51,\"轻度\"],[8,89,65,78,86,51,26,\"良\"],[9,53,33,47,64,50,17,\"良\"],[10,80,55,80,1,75,24,\"良\"],[11,117,81,124,3,45,24,\"轻度\"],[12,99,71,142,1,62,42,\"良\"],[13,95,69,130,28,74,50,\"良\"],[14,116,87,131,47,84,40,\"轻度\"],[15,108,80,121,3,85,37,\"轻度\"],[16,134,83,167,16,57,43,\"轻度\"],[17,79,43,107,5,59,37,\"良\"],[18,71,46,89,86,64,25,\"良\"],[19,97,71,113,17,88,31,\"良\"],[20,84,57,91,85,55,31,\"良\"],[21,87,63,101,9,56,41,\"良\"],[22,104,77,119,9,73,48,\"轻度\"],[23,87,62,100,1,72,28,\"良\"],[24,168,128,172,49,97,56,\"中度\"],[25,65,45,51,74,39,17,\"良\"],[26,39,24,38,61,47,17,\"优\"],[27,39,24,39,59,50,19,\"优\"],[28,93,68,96,5,79,29,\"良\"],[29,188,143,197,66,99,51,\"中度\"],[30,174,131,174,55,108,50,\"中度\"],[31,187,143,201,39,89,53,\"中度\"]]");
        String dataYQ = new String("[[[28604,77,17096869,\"武汉\",\"3月\"],[31163,77.4,27662440,\"广州\",\"3月\"],[1516,68,1154605773,\"苏州\",\"3月\"],[13670,74.7,10582082,\"太原\",\"3月\"],[28599,75,4986705,\"黄冈\",\"3月\"],[29476,77.1,56943299,\"汶川\",\"3月\"],[31476,75.4,78958237,\"蚌埠\",\"3月\"],[28666,78.1,254830,\"宿州\",\"3月\"],[1777,57.7,870601776,\"烟台\",\"3月\"],[29550,79.1,122249285,\"北京\",\"3月\"],[2076,67.9,20194354,\"上海\",\"3月\"],[12087,72,42972254,\"珠海\",\"3月\"],[24021,75.4,3397534,\"三亚\",\"3月\"],[43296,76.8,4240375,\"北海\",\"3月\"],[10088,70.8,38195258,\"马鞍山\",\"3月\"],[19349,69.6,147568552,\"威海\",\"3月\"],[10670,67.3,53994605,\"孝感\",\"3月\"],[26424,75.7,57110117,\"随州\",\"3月\"],[37062,75.4,252847810,\"鄂州\",\"3月\"]],[[44056,81.8,23968973,\"武汉\",\"4月\"],[43294,81.7,35939927,\"广州\",\"4月\"],[13334,76.9,1376048943,\"苏州\",\"4月\"],[21291,78.5,11389562,\"太原\",\"4月\"],[38923,80.8,5503457,\"黄冈\",\"4月\"],[37599,81.9,64395345,\"汶川\",\"4月\"],[44053,81.1,80688545,\"蚌埠\",\"4月\"],[42182,82.8,329425,\"宿州\",\"4月\"],[5903,66.8,1311050527,\"烟台\",\"4月\"],[36162,83.5,126573481,\"北京\",\"4月\"],[1390,71.4,25155317,\"上海\",\"4月\"],[34644,80.7,50293439,\"珠海\",\"4月\"],[34186,80.6,4528526,\"三亚\",\"4月\"],[64304,81.6,5210967,\"北海\",\"4月\"],[24787,77.3,38611794,\"马鞍山\",\"4月\"],[23038,73.13,143456918,\"威海\",\"4月\"],[19360,76.5,78665830,\"孝感\",\"4月\"],[38225,81.4,64715810,\"随州\",\"4月\"],[53354,79.1,321773631,\"鄂州\",\"4月\"]]]");

        // 3.治愈率与感染率
        String dataCI = new String("[{\"name\":[\"12月\",\"1月\",\"2月\",\"3月\",\"4月\",\"5月\",\"6月\"]},{\"one\":[66,76.9,88,99.2,99.6,99.7,99.6]},{\"two\":[82.6,81.9,81,72.4,82.7,92.7,71.6]}]");

        Map<String, String> data = new HashMap<>();
        data.put("dataEC", dataEC);
        data.put("dataBJ", dataBJ);
        data.put("dataWH", dataWH);
        data.put("dataSH", dataSH);
        data.put("dataYQ", dataYQ);
        data.put("dataCI", dataCI);
        return MessageUtil.success("success", data);
    }
}















